package C;

import java.util.Scanner;

public class C50 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();

        System.out.println(getResult(input));

    }

    public static String getResult(String input) {
        String output = "";
        boolean flag1 = false,flag2=false,flag3=false,flag4=false,flag5=false;
        for (int i = 0; i < input.length(); i++) {
            if (input.charAt(i)=='<') {
                if (output.length()>0) {
                    output = output.substring(0, output.length() - 1);
                }
            } else {
                output = output+input.charAt(i);
            }
        }

        flag1 = output.length() >= 8;
        flag2 = output.matches(".*[a-z].*");
        flag3 = output.matches(".*[A-Z].*");
        flag4 = output.matches(".*[1-9].*");
        for (int i = 0; i < output.length(); i++) {
            if (output.charAt(i)<='z'&& output.charAt(i)>='a') continue;
            else if (output.charAt(i)<='Z'&& output.charAt(i)>='A') continue;
            else if (output.charAt(i)<='9'&& output.charAt(i)>='0') continue;
            else flag5 = true;
        }
        System.out.println(flag1+" "+flag2+" "+flag3+" "+flag4+" "+flag5);

        return output+","+(flag1&&flag2&&flag3&&flag4&&flag5);
    }
}
